import pool from "../connect/db";
function sqlQuery(sql: string) {
  return new Promise((resolve,reject) => {
    pool.getConnection(function (err, $sql) {
      $sql.query(sql, (err, result) => {
        if (err) {
          reject(err)
          return console.log("错误");
        }
        resolve(result)
        $sql.release();
      });
    });
  });
}
export default sqlQuery;
